import request from "@/utils/request";

const EQUITY_MALL_BASE_URL = "/platform/mall";

const EquityMallOrderAPI = {
  getOrderPage(data: any) {
    return request({
      url: `${EQUITY_MALL_BASE_URL}/order/page`,
      method: "post",
      data,
    });
  },
  auditOrder(data: { orderId: string | number; orderStatus: string | number }) {
    return request({
      url: `${EQUITY_MALL_BASE_URL}/order/audit`,
      method: "post",
      data,
    });
  },
  getDetailById(data: { orderId: string | number }) {
    return request({
      url: `${EQUITY_MALL_BASE_URL}/order/getDetailById`,
      method: "post",
      data,
    });
  },

  changeProductShippingStatus(data: {
    orderId: string | number;
    productId: string | number;
    shippingStatus: string | number;
    shippingExt: Array<{
      name: string;
      no: string;
    }>;
  }) {
    return request({
      url: `${EQUITY_MALL_BASE_URL}/order/changeProductShippingStatus`,
      method: "post",
      data,
    });
  },
};

export default EquityMallOrderAPI;
